/**
 * Created by ${PRODUCT_NAME}.
 * User: skyler
 * Date: 2/8/11
 * Time: 9:22 AM
 * To change this template use File | Settings | File Templates.
 */
package com.thoughtorigin.display.containers {
public class VBox extends Container implements MaskedContainer, ScrollContainer, LayoutContainer {

    private var _maskContainer: DefaultMaskContainer;
    private var _scrollContainer: DefaultScrollContainer;
    private var _layoutContainer: DefaultLayoutContainer;

    public function VBox() {
        super();

        var hScroll: Scroller = new DefaultScroller();
        var vScroll: Scroller = new DefaultScroller();

        _maskContainer = new DefaultMaskContainer(this);
        _layoutContainer = new DefaultLayoutContainer(this);
        _layoutContainer.layoutPolicy = LayoutPolicy.VERTICAL_LAYOUT;
        _scrollContainer = new DefaultScrollContainer(this, _maskContainer, hScroll, vScroll);
    }

    public function set horizontalScrollPolicy(value:String):void {
        _scrollContainer.horizontalScrollPolicy = value;
    }

    public function set verticalScrollPolicy(value:String):void {
        _scrollContainer.verticalScrollPolicy = value;
    }

    public function set layoutPolicy(value:String):void {
        _layoutContainer.layoutPolicy = value;
    }

    public function set gap(value:Number):void {
        _layoutContainer.gap = value;
    }

    public function set cellWidth(value:Number):void {
        _layoutContainer.cellWidth = value;
    }

    public function set cellHeight(value:Number):void {
        _layoutContainer.cellHeight = value;
    }

    public function set overwritePlacement(value:Boolean):void {
        _layoutContainer.overwritePlacement = value;
    }

    public function refresh():void {
        _layoutContainer.refresh();
    }
    override public function set width(value:Number):void {
        _maskContainer.width = value;
    }

    override public function get height():Number {
        return _maskContainer.height;
    }

    override public function get width():Number {
        return _maskContainer.width;
    }

    override public function set height(value:Number):void {
        _maskContainer.height = value;
    }
}
}
